<template>
  <div class="app-container bg" :style="'background-image:url('+ (regionBaseURL + data.backgroundImage) + ');'">
    <!-- <img :src="regionBaseURL + data.backgroundImage" style="width:100%;"> -->
    <div class="content">
      <div class="main">
        <div class="regionIcon">
          <img v-if="data.crestImage" :src="regionBaseURL + data.crestImage" style="width: 50px;height: 50px;">
          <span v-else class="el-icon-warning" style="font-size: 50px;float: right;color:rgb(230,162,60);"></span>
        </div>
        <div class="titleContent">
          <div class="title">{{ data.name }}</div>
          <div class="subtitle">{{ data.subtitle }}</div>
        </div>
      </div>
    <div>
      <hr>
      <div style="text-align: center;margin-bottom: 10px;">
        相关英雄
      </div>
      <div class="heroList">
        <img v-for="(item, index) in heros" :key="index" :src="item.avatar" style="width:30px;height: 30px;">
      </div>
    </div>
    <hr>
    <div>
      <div class="description">{{ data.description }}</div>
    </div>
  </div>
  </div>
</template>

<script>
import { REGION_RELATED_IMAGE_BASE_URL } from '@/const/imageBaseURL'
export default {
  name: 'regionDetail',
  props: {
    data: {
      type: Object,
      default() {
        return {}
      }
    },
    heros: {
      type: Array,
      default() {
        return []
      }
    }
  },
  data() {
    return {
      regionBaseURL: REGION_RELATED_IMAGE_BASE_URL
    }
  },
  methods: {

  }
}
</script>

<style scoped>
.bg {
  background-size: cover;
  background-position: center center;
  color: rgb(240,230,210);
}
.main {
  display: flex;
  margin-bottom: 20px;
  justify-content: center;
}
.titleContent {
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.regionIcon {
  margin-right: 20px;
}
.title {
  text-align: center;
  font-size: 24px;
  font-weight: 700;
}
.subtitle {
  text-align: center;
  font-weight: 700;
  font-size: 14px;
  color: rgb(160,155,140);
}
.heroList {
  display: flex;
  flex-wrap: wrap;
}
.description {
  font-size: 16px;
  color: rgb(160,155,140);
  text-indent: 2em;
}
</style>

